using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;
using System;



public partial class LinkDialog
{

    public string Res = "Cancel";
    public string Link = null;

    public LinkDialog()
    {
        InitializeComponent();
    }
    public void OKButton_Click(System.Object sender, RoutedEventArgs e)
    {
        Link = TextBox1.Text;
        Res = "OK";
        Close();
    }

    public void TextBox1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Enter && TextBox1.Text.Length > 0)
        {
            OKButton_Click(null, null);
        }
    }

    public void TextBox1_TextChanged(object sender, TextChangedEventArgs e)
    {
        if (TextBox1.Text.Length > 0)
        {
            OKButton.IsEnabled = true;
        }
        else
        {
            OKButton.IsEnabled = false;
        }
    }

    public void LinkDialog_Loaded(object sender, RoutedEventArgs e)
    {
        if (MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnWin7 || MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnVista)
        {
            AppHelper.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1));
        }
        TextBox1.Focus();
    }
}

